package flyweight;

import java.util.HashMap;
import java.util.Map;

/**
 * @author wcj
 * @Date 2021/7/11 23:38
 * @Version 1.0
 */
public class FlyWeightFactory {

    private Map<String, WebSite> map = new HashMap<>();

    public WebSite getWebSite(String key) {
        if (!map.containsKey(key)) {
            map.put(key, new ConcreteWebSite(key));
        }
        return map.get(key);
    }
}
